package com.yzf.demo.demo.GenericParadigm;

import lombok.Data;

/**
 * Created by 于占峰 on 2020/3/27/027.
 */
@Data
public class DemoBean2<V> {
    private V value;

    public DemoBean2(V value) {
        this.value = value;
    }

    public DemoBean2() {

    }

    public static void main(String[] args) {
        //实例化类的传入类定义泛型的具体类型
        DemoBean2<String> demoBean = new DemoBean2<String>();
        DemoBean2<String> demoBean1 = new DemoBean2<String>("DemoBean");
        DemoBean2<Integer> demoBean2 = new DemoBean2<Integer>(8888);
        System.out.println(demoBean);
        System.out.println(demoBean1);
        System.out.println(demoBean2);
    }
}
